package com.zhongxi.guoyuan.entity.shopcart;

import org.json.JSONObject;

/**
 * Created by Administrator on 2017/8/25.
 */

public class RewardSummary {

    private String postage;
    private String goodsnum;
    private String amount;
    private String backinnernum;   //美豆
    private String backredbean;
    private String unitprice;
    private String price;
    private String backcashnum;


    public String getPostage() {
        return postage;
    }

    public void setPostage(String postage) {
        this.postage = postage;
    }

    public String getGoodsnum() {
        return goodsnum;
    }

    public void setGoodsnum(String goodsnum) {
        this.goodsnum = goodsnum;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getBackinnernum() {
        return backinnernum;
    }

    public void setBackinnernum(String backinnernum) {
        this.backinnernum = backinnernum;
    }

    public String getBackredbean() {
        return backredbean;
    }

    public void setBackredbean(String backredbean) {
        this.backredbean = backredbean;
    }

    public String getUnitprice() {
        return unitprice;
    }

    public void setUnitprice(String unitprice) {
        this.unitprice = unitprice;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getBackcashnum() {
        return backcashnum;
    }

    public void setBackcashnum(String backcashnum) {
        this.backcashnum = backcashnum;
    }

    public static RewardSummary parseObject(JSONObject object) {
        RewardSummary rewardSummary = new RewardSummary();
        rewardSummary.setAmount(object.optString("amount"));
        rewardSummary.setBackinnernum(object.optString("backinnernum"));
        rewardSummary.setBackredbean(object.optString("backredbean"));
        rewardSummary.setGoodsnum(object.optString("goodsnum"));
        rewardSummary.setPostage(object.optString("postage"));
        if (null != object.optString("unitprice") && !"".equals(object.optString("unitprice"))) {
            rewardSummary.setUnitprice(object.optString("unitprice"));
        } else {
            rewardSummary.setUnitprice("");
        }
        if (null != object.optString("price") && !"".equals(object.optString("price"))) {
            rewardSummary.setPrice(object.optString("price"));
        } else {
            rewardSummary.setPrice("");
        }
        rewardSummary.setBackcashnum(object.optString("backcashnum"));
        return rewardSummary;
    }
}
